limsSampleType.choosePage = {

    getGridParam : function() {
        var _this = this, columns = limsSampleType.getChooseListColumns(),requestData = this.param;
        this.param.single ? columns.unshift({
            radio : true
        }) : columns.unshift({
            checkbox : true
        });
        return {
            type : 'grid',
            id : 'sample-type-choose-list-grid',
            url : limsSampleType.baseUrl + '/queries/raw',
            order : {'sampleTypeCode': 'asc'},
            columns : columns,
            requestData : requestData,
            filterOpen: true,
            toolbar : [{
                type : 'button',
                text : 'GIKAM.BUTTON.CONFIRM',
                icon : 'select',
                onClick : function() {
                    Gikam.getLastModal().close(Gikam.getComp('sample-type-choose-list-grid').getSelections());
                }
            }, {
                type : 'button',
                text : 'GIKAM.BUTTON.CANCEL',
                icon : 'cancel',
                onClick : function() {
                    Gikam.getLastModal().close();
                }
            }]
        }
    },

    create : function() {
        var _this = this;
        Gikam.create('layout', {
            renderTo : Gikam.getLastModal().window.$dom,
            center : {
                items : [ this.getGridParam() ]
            }
        });
    },

    init : function(param) {
        this.param = param;
        this.create();
    }
};
